/*
 * @Author: zshawk1982
 * @Date: 2021-09-18 09:48:27
 * @LastEditTime: 2022-10-19 10:33:17
 * @LastEditors: zshawk1982
 * @Description:
 * @FilePath: \media_web_client\src\store\index.js
 */
import { createStore } from "vuex";

export default createStore({
  state: {
    collapse: false,
    tagsList: [], //存放所有tag标签的数组
  },
  mutations: {
    handleCollapse(state, data) {
      state.collapse = data;
    },
    // 删除一个tag
    delTagsItem(state, data) {
      state.tagsList.splice(data.index, 1);
    },
    //添加一个tag
    setTagsItem(state, data) {
      state.tagsList.push(data);
    },
    // 清除其他tag
    clearTagsOther(state, data) {
      state.tagsList = data;
    },
    // 清除所有tag
    clearTags(state) {
      state.tagsList = [];
    },
  },
  actions: {},
  modules: {},
});
